package cn.autumnorange.app.common.gts;

import com.taobao.txc.client.aop.TxcTransactionScaner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class GTSConfig {
    // 定义声明式事务，要想让事务annotation感知的话，要在这里定义一下
    @Bean(name = "txcScanner")
    //    读取配置文件前缀为aluser的属性值 aluser:
    //  accessKey: xxxx
    //  secretKey: xxxx
    //    @ConfigurationProperties(prefix="aluser")
    public TxcTransactionScaner txcTransactionScaner() {
        // xxxx填写txc的逻辑组名
        //        return  new TxcTransactionScaner("xxx");
        //        修改为公网txc
        //         <bean class="com.taobao.txc.client.aop.TxcTransactionScaner">
        //    <constructor-arg value="myapp"/>
        //    <constructor-arg value="txc_test_public.1129361738553704.QD"/>
        //    <constructor-arg value="1" />
        //    <constructor-arg value="https://test-cs-gts.aliyuncs.com" />
        //    </bean>
        return new TxcTransactionScaner(
                "myapp", "txc_test_public.1129361738553704.QD", 1, "https://test-cs-gts.aliyuncs.com");
    }
}
